zynqmp: pm: Implemented 'get_op_characteristic' PM API call
authorAnes Hadziahmetagic <[email protected]>
Thu, 12 May 2016 14:17:30 +0000 (16:17 +0200)
committerSoren Brinkmann <[email protected]>
Tue, 24 May 2016 17:18:07 +0000 (10:18 -0700)
Signed-off-by: Anes Hadziahmetagic <[email protected]>
Signed-off-by: Filip Drazic <[email protected]>
Signed-off-by: Soren Brinkmann <[email protected]>
plat/xilinx/zynqmp/pm_service/pm_api_sys.c
plat/xilinx/zynqmp/pm_service/pm_api_sys.h
plat/xilinx/zynqmp/pm_service/pm_defs.h
plat/xilinx/zynqmp/pm_service/pm_svc_main.c

index 053281ee072c1a9020fd18bd08fd9076da48fb5f..5af0163eec0cb2d75d3dedd8c98640828d7a3b89 100644 (file)
@@ -395,17 +395,25 @@ enum pm_ret_status pm_register_notifier(enum pm_node_id nid,
 }
 
 /**
- * pm_get_op_characteristic() - PM call to get a particular operating
- *                             characteristic of a node
- * @nid        Node ID
- * @type       Operating characterstic type to be returned
+ * pm_get_op_characteristic() - PM call to request operating characteristics
+ *                             of a node
+ * @nid                Node id of the slave
+ * @type       Type of the operating characteristic
+ *             (power, temperature and latency)
+ * @result     Returns the operating characteristic for the requested node,
+ *             specified by the type
  *
  * @return     Returns status, either success or error+reason
  */
 enum pm_ret_status pm_get_op_characteristic(enum pm_node_id nid,
-                                           enum pm_opchar_type type)
+                                           enum pm_opchar_type type,
+                                           uint32_t *result)
 {
-       return PM_RET_ERROR_NOTSUPPORTED;
+       uint32_t payload[PAYLOAD_ARG_CNT];
+
+       /* Send request to the PMU */
+       PM_PACK_PAYLOAD3(payload, PM_GET_OP_CHARACTERISTIC, nid, type);
+       return pm_ipi_send_sync(primary_proc, payload, result);
 }
 
 /* Direct-Control API functions */
index f0365cd9979492e758758a8d0f45f76b9ac939da..22bdb4774f293d52d900507e245ae0c871472a48 100644 (file)
@@ -91,7 +91,8 @@ enum pm_ret_status pm_register_notifier(enum pm_node_id nid,
                                        unsigned int wake,
                                        unsigned int enable);
 enum pm_ret_status pm_get_op_characteristic(enum pm_node_id nid,
-                                           enum pm_opchar_type type);
+                                           enum pm_opchar_type type,
+                                           uint32_t *result);
 enum pm_ret_status pm_acknowledge_cb(enum pm_node_id nid,
                                     enum pm_ret_status status,
                                     unsigned int oppoint);
index 08f4aab7990bc13b023706174e8fd1b37744e1d6..2fd05fe900c7c4e14ce65ec69ebc41ce5c77e22a 100644 (file)
@@ -171,8 +171,8 @@ enum pm_ram_state {
 
 enum pm_opchar_type {
        PM_OPCHAR_TYPE_POWER = 1,
-       PM_OPCHAR_TYPE_ENERGY,
        PM_OPCHAR_TYPE_TEMP,
+       PM_OPCHAR_TYPE_LATENCY,
 };
 
 /**
index 67440650bb1d9c33ba76e5b1e858de0e88c6a853..e3c25c31cc301fe9dddf4dbf5ff6d3e22df14e51 100644 (file)
@@ -191,8 +191,12 @@ uint64_t pm_smc_handler(uint32_t smc_fid, uint64_t x1, uint64_t x2, uint64_t x3,
                SMC_RET1(handle, (uint64_t)ret);
 
        case PM_GET_OP_CHARACTERISTIC:
-               ret = pm_get_op_characteristic(pm_arg[0], pm_arg[1]);
-               SMC_RET1(handle, (uint64_t)ret);
+       {
+               uint32_t result;
+
+               ret = pm_get_op_characteristic(pm_arg[0], pm_arg[1], &result);
+               SMC_RET1(handle, (uint64_t)ret | ((uint64_t)result << 32));
+       }
 
        case PM_REGISTER_NOTIFIER:
                ret = pm_register_notifier(pm_arg[0], pm_arg[1], pm_arg[2],